package com.jhl.seckill.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 负载均衡策略配置
 */

@Configuration
public class RibbonConfiguration {


    /**
     * 随机策略
     */
    @Bean
    public IRule loadBalanceRule() {
        return new WeightedResponseTimeRule();
    }
}
